start_tomcat(){ 
 now=`date "+%Y%m%d%H%M%S"` 
 exec
 java -Xms64m -Xmx256m -jar ../spring-eureka-registry/spring-eureka-registry-1.0-SNAPSHOT.jar --server.port=8763 --config.name=spring-eureka-registry > ../logs/spring-eureka-registry.log &
} 
#停止方法 
shutdown_tomcat(){ 
 ps aux|grep spring-eureka-registry|grep 8763|grep -v grep|awk '{print $2}'|while read pid 
 do 
    kill -9 $pid
 done
} 
   
case "$1" in
	start)
		start_tomcat
		;;
	stop)
		shutdown_tomcat
		;;
	restart)
		shutdown_tomcat
		start_tomcat
		;;
	*)
		printf 'Usage: %s {start|stop|restart}\n' "$testg"
		exit 1
		;;
esac
